<template>
	<div>
		<div style="width: 100vw;display: flex;">
			<div style="width: 5vw;" @click="back">
				<van-icon name="arrow-left" size="20" />
			</div>
			<div
				style="width: 95vw; font-weight: bold;text-align: left;margin-left: 5%;font-size:1.8rem;text-align: center;">
				{{name}}
			</div>
		</div>
		<div id="" style="width: 100vw;display: flex;flex-wrap: wrap;margin-top: 2vh;">

			<div v-for="item in list" style="width: 45vw;margin-left: 2vw;margin-top: 2vh;">
				<router-link :to="{path:'/details',query:{goods_id:item.goods_id}}">
					<div><img v-lazy="url+item.original_img" style="width: 40vw;"></div>
					<div
						style="margin-left: 4vw; font-weight: bold;overflow: hidden;text-overflow: ellipsis; white-space: nowrap;width: 45vw;">
						{{item.goods_name}}
					</div>
					<div class="details">
						{{item.goods_name}}
					</div>

					<div style="margin-left: 4vw;width: 45vw;font-size: 1.7rem;text-align: left;color: red;">
						<span style="font-size: 0.1rem;">￥</span> {{item.shop_price}}
					</div>
				</router-link>
			</div>
		</div>
	</div>
</template>

<script>
	export default {
		data() {
			return {
				list: [],
				url: '',
				name: '',
				page:1,
				limit:10,
				ispage:true
			}
		},
		
		methods: {
			back() {
				this.$router.push('/')
			}
		},
		created() {
			// console.log(1)
			let id = this.$route.query.id
			this.name = this.$route.query.name
			// console.log(id, 7777)
			this.$store.dispatch("user/Get_NavFl", id).then(e => {

				// console.log(e.data.data, 111)
				this.list = e.data.data
			})
			//获取url
			this.$store.dispatch("user/Home_Url").then(e => {
				// console.log(e,111)
				this.url = e
			})

		},
		mounted() {

		}
	}
</script>

<style>
</style>
